<template>
  <a-cascader v-model:value="value" :options="options" :placeholder="placeholder" />
</template>

<script>
  import { getXzqhList } from '@/api/api'
  export default {
    name: "JDictCascader",
    props: {
      dictCode: String,
      placeholder: String,
      disabled: Boolean,
      value: Array,
      options: Array
    },
    computed: {
      getValueSting(){
        // update-begin author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
        // 当有null或“” placeholder不显示
        return this.value != null ? this.value.toString() : undefined;
        // update-end author:wangshuai date:20200601 for: 不显示placeholder的文字 ------
      },
    },
    methods: {
      initDictData() {
        //根据字典Code, 初始化字典数组
        getXzqhList().then((res) => {
          if (res.success) {
               console.log(res.result);
            this.dictOptions = res.result;
          }
        })
      },
      
      setCurrentDictOptions(dictOptions){
        this.dictOptions = dictOptions
      },
      getCurrentDictOptions(){
        return this.dictOptions
      }
    },
    model:{
      prop: 'value',
      event: 'change'
    }
  }
</script>

<style>
</style>